/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum CxlRejReason implements org.f1x.api.message.types.IntEnum {
	TOO_LATE_TO_CANCEL(0),
	UNKNOWN_ORDER(1),
	BROKER_EXCHANGE_OPTION(2),
	ORDER_ALREADY_IN_PENDING_CANCEL_OR_PENDING_REPLACE_STATUS(3),
	UNABLE_TO_PROCESS_ORDER_MASS_CANCEL_REQUEST(4),
	ORIGORDMODTIME_DID_NOT_MATCH_LAST_TRANSACTTIME_OF_ORDER(5),
	DUPLICATE_CLORDID_RECEIVED(6),
	OTHER(99);

	private final int code;

	CxlRejReason (int code) {
		this.code  = code;
	}

	public int getCode() { return code; }

	public static CxlRejReason parse(String s) {
		switch(s) {
			case "0" : return TOO_LATE_TO_CANCEL;
			case "1" : return UNKNOWN_ORDER;
			case "2" : return BROKER_EXCHANGE_OPTION;
			case "3" : return ORDER_ALREADY_IN_PENDING_CANCEL_OR_PENDING_REPLACE_STATUS;
			case "4" : return UNABLE_TO_PROCESS_ORDER_MASS_CANCEL_REQUEST;
			case "5" : return ORIGORDMODTIME_DID_NOT_MATCH_LAST_TRANSACTTIME_OF_ORDER;
			case "6" : return DUPLICATE_CLORDID_RECEIVED;
			case "99" : return OTHER;
		}
		return null;
	}

}